<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>微博搜索</title>
		<link rel="stylesheet" href="../../../common/css/search/card.css" />
		<link rel="stylesheet" href="../../../common/css/search/global.css" />
		<link rel="stylesheet" href="../../../common/css/search/layer_show_pic.css" />
		<link rel="stylesheet" href="../../../common/css/search/module.css" />
		<link rel="stylesheet" href="../../../common/css/search/page.css" />
		<link rel="stylesheet" href="../../../common/css/search/video.css" />
		<script type="text/javascript" src="../../../common/js/jQuery-3.3.1.js"></script>
		
		<script type="text/javascript">
			$(document).ready(function(){				
				//搜索栏
				$(".s_button").on("click",function(){
					var searchText = $(".search_input").val();
					console.log(searchText);
					window.location.href="/searchlogic/topic?searchText="+searchText;
				})
				//搜索微博项
				$(".a_weibo").on("click",function(){
					var searchText = $(".search_input").val();
					console.log(searchText);
					window.location.href="/searchlogic/weibo?searchText="+searchText;
				})
				
				//搜索找人项
				$(".a_find").on("click",function(){
					var searchText = $(".search_input").val();
					console.log(searchText);
					window.location.href="/searchlogic/find?searchText="+searchText;
				})
				
				//搜索文章项
				$(".a_article").on("click",function(){
					var searchText = $(".search_input").val();
					console.log(searchText);
					window.location.href="/searchlogic/article?searchText="+searchText;
				})
				
				//搜索话题项
				$(".a_topic").on("click",function(){
					var searchText = $(".search_input").val();
					console.log(searchText);
					window.location.href="/searchlogic/topic?searchText="+searchText;
				})
			});
		</script>
	</head>

	<body>
		<div class="m-main">
			<!--搜索-->
			<div class="m-search" id="pl_feedtop_top">
				<div class="logo">
					<a href="#">
						<img src="../../../common/img/huzihan/search_logo.png" class="logo_img" />
					</a>
				</div>
				<div class="searchbox">
					<div class="search-input">
						<c:choose>
						<c:when test="${empty context }">
							<input class="search_input" type="text" maxlength="40"
							autocomplete="off" value="" />
						</c:when>
						<c:otherwise>
							<input class="search_input" type="text" maxlength="40"
							autocomplete="off" value="${context}" />
						</c:otherwise>
						</c:choose>
					</div>
					<button class="s-btn-b s_button">搜索</button>
				</div>
			</div>
			<!--/搜索-->
			<!--主导航-->
			<div class="m-main-nav s-mt28">
				<ul>
					<li>
						<a class="a_weibo" href="javascript:;" title="微博">微博</a>
					</li>
					<li>
						<a class="a_find" href="javascript:;" title="找人">找人</a>
					</li>
					<li>
						<a class="a_article" href="javascript:;" title="文章">文章</a>
					</li>
					<li>
						<a class="cur a_topic" href="javascript:;" title="话题">话题</a>
					</li>
				</ul>
			</div>
			<!--/主导航-->
			<div id="pl_feed_main">
				<!--内容-->
				<div class="m-wrap">
					<div class="m-con-l" id="pl_feedlist_index">
						<!--话题列表-->
						<c:choose>
						<c:when test="${empty topiclist}">
							<div class="card-wrap">
    							<div class="card card-no-result s-pt20b40">
                					<p>抱歉，未找到${context}相关结果。</p>
                					<dl>
            							<dt>建议:</dt>
            							<dd>您可以尝试更换关键词，再次搜索。</dd>
            							<dd>请尽量输入常用词</dd>
            							<dd>请尽量使用简洁的关键词</dd>
        							</dl>
   			 					</div>
							</div>
						</c:when>
						<c:otherwise>
						<c:forEach items="${topiclist }" var="topic" varStatus="sta">
						<c:if test="${sta.index < 5 }">
						<div class="card-wrap s-pg16">
							<div class="card card-direct-a s-mb20">
								<div class="pic-l">
									<a href="#"><img alt="暂无图片" src="http://localhost:8082/serverpath/${topic.topicImgpath}"></a>
								</div>
								<div class="info">
									<div>
										<a href="#" class="name">${topic.topicName }</a>
									</div>
									<p></p>
									<p>${topic.topicDiscussnum }讨论 ${topic.topicReadnum }阅读</p>
								</div>
							</div>
						</div>
						</c:if>
						</c:forEach>
						</c:otherwise>
						</c:choose>
						<!--/话题列表-->
						<!--翻页-->
						<!--未登录提示-->
						<div class="m-hint"><i class="icon-warn icon-hint-s"></i>
							<a href="#" action-type="login">立即登录</a>查看更多结果。还没有账号？赶紧
							<a href="#" target="_blank">注册微博</a>
						</div>
						<!--未登录提示-->

						<!--/翻页-->

					</div>

					<div class="m-con-r">
						<!--话题右侧流加载-->
						
					</div>
				</div>
				<!--/内容-->
			</div>
		</div>
		<div class="m-footer">
			<div class="bottom">
				<div class="m-outlink">
					<div class="link">
						<a href="http://ir.weibo.com/phoenix.zhtml?c=253076&amp;p=irol-irhome" class="icon-wb" target="_blank" title="关于微博">关于微博</a>
						<a href="http://help.weibo.com/?refer=didao&amp;bottomnav=1&amp;wvr=5" target="_blank" title="微博帮助">微博帮助</a>
						<a href="http://help.weibo.com/newtopic/suggest?bottomnav=1&amp;wvr=5" target="_blank" title="意见反馈">意见反馈</a>
						<a href="http://open.weibo.com/?bottomnav=1&amp;wvr=5" target="_blank" title="开放平台">开放平台</a>
						<a href="http://hr.weibo.com/?bottomnav=1&amp;wvr=5" target="_blank" title="微博招聘">微博招聘</a>
						<a href="http://news.sina.com.cn/guide/?bottomnav=1&amp;wvr=5" target="_blank" title="新浪网导航">新浪网导航</a>
						<a href="http://service.account.weibo.com/?bottomnav=1&amp;wvr=5&amp;is_redirected=1" target="_blank" title="社区管理中心">社区管理中心</a>
						<a href="http://service.account.weibo.com/roles/gongyue?bottomnav=1&amp;wvr=5&amp;is_redirected=1" target="_blank" title="微博社区公约">微博社区公约</a>
					</div>
					<p class="copyright">
						Copyright © 2009-2019 WEIBO 北京微梦创科网络技术有限公司
						<a href="https://weibo.com/aj/static/jww.html" target="_blank">京网文[2011]0398-130号</a>
						<a href="http://www.miibeian.gov.cn" target="_blank">京ICP备12002058号</a>
					</p>
				</div>
			</div>
		</div>
	</body>

</html>